﻿using System.Windows.Forms;

namespace Sl.Support.Forms {
    /// <summary>
    /// 解决工具栏按钮不能一次点击触发的问题
    /// </summary>
    internal class ToolStrip : System.Windows.Forms.ToolStrip {
        protected override void WndProc(ref Message m) {
            const int WM_MOUSEACTIVATE = 0x21;

            if (m.Msg == WM_MOUSEACTIVATE && this.CanFocus && !this.Focused)
                this.Focus();

            base.WndProc(ref m);
        }
    }
}

